package com.speedchina.common.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 * @author ZhangWC
 * @date 2021/6/29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ConversionErrorResult {

    /**
     * 表头
     */
    private String head;

    /**
     * 错误行
     */
    private Long row;

    /**
     * 转换错误原因
     */
    private String errorReason;

    @Override
    public String toString(){
        StringBuffer str = new StringBuffer();
        if(StringUtils.isNotBlank(head)){
            str.append("表头:").append(head).append(",");
        }
        if(row != null) {
            str.append("行号:").append(row).append(",");
        }
        if(StringUtils.isNotBlank(errorReason)) {
            str.append("错误信息:").append(errorReason).append(";");
        }
        return str.toString();
    }

}
